package com.xinguan.system.mapper;

import com.xinguan.system.entity.Health;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author lawrence
 * @create 2020-11-13
 */
public interface HealthMapper extends Mapper<Health> {

    /**
     * 今日是否打卡
     * @param id
     * @return
     */
    //当数据库表字段与属性值不一样时，可以使用别名，也可以配置mybatis驼峰式 ==>map-underscore-to-camel-case: true
//    @Select("select id,address,user_id as userId,situation,touch,passby,reception,create_time as createTime from biz_health where create_time < (CURDATE()+1) " +
//            " and create_time>CURDATE() and user_id=#{id}")
    //如下需要配置map-underscore-to-camel-case: true
    @Select("select * from biz_health where create_time < (CURDATE()+1) " +
            " and create_time>CURDATE() and user_id=#{id}")
    List<Health> isReport(@Param("id") Long id);
}
